# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pygtksourceview2
_pkgname=pygtksourceview
pkgver=2.10.1
pkgrel=7
pkgdesc='Python bindings for gtksourceview2.'
url='http://www.gnome.org/'
arch=('x86_64' 'aarch64')
license=('GPL')
depends=('gtksourceview2>=2.10.0' 'pygtk>=2.17.0')
makedepends=('intltool' 'pkg-config')
source=("https://download.gnome.org/sources/$_pkgname/2.10/$_pkgname-$pkgver.tar.bz2")
sha512sums=('6f8f35ba36cb26f256861ff7f14c3236cf566d6d02f3dea69f63844081caee969ad6288a2aa48d35d4eb542cda73da9d4bfe2cc57548ca15cd372011cab0276e')

build() {
  cd "$_pkgname-$pkgver"

  if [[ "$CARCH" == "x86_64" ]]; then
    PYTHON=python2 ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static --disable-docs
  else
    PYTHON=python2 ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static --disable-docs --build=arm
  fi

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

